package com.gxf.drugmg.repository;

import com.gxf.drugmg.entity.Drug;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface DrugRepository extends JpaRepository<Drug, Long> {
    List<Drug> findByNameContainingIgnoreCase(String name);
    
    @Query("SELECT d FROM Drug d WHERE d.manufacturer = ?1")
    List<Drug> findByManufacturer(String manufacturer);
}